// 自己的飞机对象
var selfPlane = {
	x:0,
	y:0,
	score:0,
	e:null,
	init:function(){
		this.x = (Util.windowWidth - Util.selfPlaneElement.width)/2;
		this.y = (Util.windowHeight - Util.selfPlaneElement.height);
		this.e = Util.selfPlaneElement;
		Util.selfPlaneElement.style.left = this.x+"px";
		Util.selfPlaneElement.style.top = this.y+"px";
		Util.wrapElement.appendChild(this.e);
	},
	move:function(moveX,moveY){
		var x = this.x + moveX;
		var y = this.y + moveY;

		if(x<0-this.e.width/2||x>Util.windowWidth-this.e.width/2){
			return;
		}
		if(y<0-this.e.height/2||y>Util.windowHeight-this.e.height/2){
			return;
		}
		this.x = x;
		this.y = y;

		this.e.style.left = this.x+"px";
		this.e.style.top = this.y+"px";

	},
	moveTo:function(x,y){

		if(x<0-this.e.width/2||x>Util.windowWidth-this.e.width/2){
			return;
		}
		if(y<0-this.e.height/2||y>Util.windowHeight-this.e.height/2){
			return;
		}
		this.x = x;
		this.y = y;

		this.e.style.left = this.x+"px";
		this.e.style.top = this.y+"px";
	}
}